home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Hacks
/
Hacks ’95
/
Desktop Pets
/
LayerMgr.h
< prev
next >
Wrap
Text File
|
1995-08-28
|
2KB
|
57 lines
/* Layers.h */
/* Part of the undocumented Layer Manager structures and calls
* Information found with the help of MacsBug under MacOS 7.0.
*
* What I found was that a layer is associated with each running
* applications (if it has a user-interface), which groups all
* windows of that application. This is how you can hide an application
* (remember 'applications' menu under system 7) and get the list of
* other applications windows. Have fun.
*/
#include <Processes.h>
// LayerRecord is similar to a WindowRecord.
typedef WindowRecord LayerRecord;
typedef WindowPeek LayerPtr;
// This records some information on the process which owns
// the layer... Most of it is not clear (there are pointers
// to other LayerRecords, to a heap zone, etc. in the unknown
// parts)
typedef struct {
long unknown1;
OSType signature; // The process sig.
OSType creator; // The process creator
char unknown2[24];
ProcessSerialNumber layerPSN; // The process PSN
char unknown3[40];
Handle moreLayerInfo; // This handle is 212 bytes sized.
} LayerInfo, *LayerInfoPtr;
// This function returns a pointer to the first layer record
// of the front layer on screen (front application).
// Other ones are then accessed by the GetNextLayer macro.
pascal LayerPtr GetFirstLayer(void) TWOWORDINLINE (0x7003, 0xA829);
// This function returns a pointer to the first window record
// in the windows list of this layer.
pascal WindowPtr GetFirstLayerWindow(LayerPtr aLayer) TWOWORDINLINE (0x7006, 0xa829);
// Some macros to access other information, and to hide and show a layer
#define GetNextLayer(aLayer) (aLayer->nextWindow)
#define GetLayerInfo(aLayer) ((LayerInfoPtr)aLayer->refCon)
#define HideLayer(aLayer) HideWindow((WindowPtr)aLayer)
#define ShowLayer(aLayer) ShowWindow((WindowPtr)aLayer)
#define ShowHideLayer(aLayer,showFlag) ShowHide((WindowPtr)aLayer,showFlag)
#define HiddenLayer(aLayer) aLayer->visible
// GetLayerName will return an address in a handle. Be aware of that.
#define GetLayerName(aLayer) (unsigned char *) ( (*GetLayerInfo(aLayer)->moreLayerInfo) + 0x38)
// Prototypes
LayerPtr FindLayerForSignature(OSType processSig);
WindowPtr GetFrontWindowForSignature(OSType processSig);